package timeitj.ejb.persistence;

import java.io.Serializable;
import javax.annotation.security.DeclareRoles;
import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;

/**
 *
 * @author kunee
 */
@DeclareRoles({"USERS","ADMINS"})
public interface PersistenceManager<T, ID extends Serializable>{
    
    @PermitAll
    public T create(T entity);
    
    @RolesAllowed("USERS")
    public T getById(ID id);
    
    @RolesAllowed("USERS")
    public T update(T entity);
    
    @RolesAllowed("USERS")
    public void store(T entity);
    
    @RolesAllowed("USERS")
    public void delete(T entity);
}
